setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
load('CheackPointOne.RData')

Cuarta Clasificacion: pEhExvsU2AF84

head(pEhExvsU2AF84,10);
##          GenId    CDC5_1    CDC5_2      CDC5_3   pEhEx_1    pEhEx_2     pEhEx_3
## 1  EHI_000130A  59.61996  70.37838   610.61850 140.16143  346.92628  381.749395
## 2  EHI_000140A 118.22941 206.99523    91.94642 282.69848  273.39300   30.952654
## 3  EHI_000240A 689.16628 871.44992 11090.15226 940.74452 1549.85546 1693.797993
## 4  EHI_000250A 426.43427 406.74563  1607.88347 260.13011  262.08018  525.621915
## 5  EHI_000260A 104.08230 109.70747   422.01047  87.30394   53.73586   40.123810
## 6  EHI_000280A  40.42031  35.18919   108.44962  43.94892   66.93415   49.294967
## 7  EHI_000290A  15.15762  19.66455    44.79441  14.84761   11.31281   64.771294
## 8  EHI_000300A  74.77757  94.18283     2.35760 106.90279   92.38798   25.220681
## 9  EHI_000410A  15.15762  15.52464   134.38322  22.56837   19.79742   52.160953
## 10 EHI_000430A  18.18914  23.80445    28.29120  20.78665   11.31281    8.597959
nbreaks <- 10
data4 <- pEhExvsU2AF84;       head(data4)
##         GenId    CDC5_1    CDC5_2      CDC5_3   pEhEx_1    pEhEx_2    pEhEx_3
## 1 EHI_000130A  59.61996  70.37838   610.61850 140.16143  346.92628  381.74940
## 2 EHI_000140A 118.22941 206.99523    91.94642 282.69848  273.39300   30.95265
## 3 EHI_000240A 689.16628 871.44992 11090.15226 940.74452 1549.85546 1693.79799
## 4 EHI_000250A 426.43427 406.74563  1607.88347 260.13011  262.08018  525.62192
## 5 EHI_000260A 104.08230 109.70747   422.01047  87.30394   53.73586   40.12381
## 6 EHI_000280A  40.42031  35.18919   108.44962  43.94892   66.93415   49.29497

Log-NormalizaciĂ³n

sample1   <- data4$pEhEx_1; sample2   <- data4$pEhEx_2; sample3   <- data4$pEhEx_3;
samplevs1 <- data4$CDC5_1;  samplevs2 <- data4$CDC5_2;  samplevs3 <- data4$CDC5_3;
log2sample1 <- log2(sample1+1);         log2sample2 <- log2(sample2+1)
log2sample3 <- log2(sample3+1);         log2samplevsCDC51 <- log2(samplevs1+1)
log2samplevsCDC52 <- log2(samplevs2+1); log2samplevsCDC53 <- log2(samplevs3+1)
data4 <- cbind(data4, log2sample1,log2sample2,log2sample3,
               log2samplevsCDC51,log2samplevsCDC52,log2samplevsCDC53)
head(data4)
##         GenId    CDC5_1    CDC5_2      CDC5_3   pEhEx_1    pEhEx_2    pEhEx_3
## 1 EHI_000130A  59.61996  70.37838   610.61850 140.16143  346.92628  381.74940
## 2 EHI_000140A 118.22941 206.99523    91.94642 282.69848  273.39300   30.95265
## 3 EHI_000240A 689.16628 871.44992 11090.15226 940.74452 1549.85546 1693.79799
## 4 EHI_000250A 426.43427 406.74563  1607.88347 260.13011  262.08018  525.62192
## 5 EHI_000260A 104.08230 109.70747   422.01047  87.30394   53.73586   40.12381
## 6 EHI_000280A  40.42031  35.18919   108.44962  43.94892   66.93415   49.29497
##   log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1    7.141202    8.442638    8.580256          5.921721          6.157415
## 2    8.148215    8.100100    4.997864          6.897596          7.700407
## 3    9.879192   10.598849   10.726898          9.430800          9.768929
## 4    8.028625    8.039359    9.040624          8.739559          8.671526
## 5    6.464406    5.774415    5.361902          6.715376          6.790609
## 6    5.490215    6.086065    5.652342          5.372266          5.177487
##   log2samplevsCDC53
## 1          9.256488
## 2          6.538327
## 3         13.437122
## 4         10.651844
## 5          8.724550
## 6          6.774123
save.image('CheckPointFour.RData')
setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
#load('CheckPointTwo.RData')
library(ggplot2);library(dplyr);library("fitdistrplus");
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
## Loading required package: survival
library("MASS");library("survival")
head(data4)
##         GenId    CDC5_1    CDC5_2      CDC5_3   pEhEx_1    pEhEx_2    pEhEx_3
## 1 EHI_000130A  59.61996  70.37838   610.61850 140.16143  346.92628  381.74940
## 2 EHI_000140A 118.22941 206.99523    91.94642 282.69848  273.39300   30.95265
## 3 EHI_000240A 689.16628 871.44992 11090.15226 940.74452 1549.85546 1693.79799
## 4 EHI_000250A 426.43427 406.74563  1607.88347 260.13011  262.08018  525.62192
## 5 EHI_000260A 104.08230 109.70747   422.01047  87.30394   53.73586   40.12381
## 6 EHI_000280A  40.42031  35.18919   108.44962  43.94892   66.93415   49.29497
##   log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1    7.141202    8.442638    8.580256          5.921721          6.157415
## 2    8.148215    8.100100    4.997864          6.897596          7.700407
## 3    9.879192   10.598849   10.726898          9.430800          9.768929
## 4    8.028625    8.039359    9.040624          8.739559          8.671526
## 5    6.464406    5.774415    5.361902          6.715376          6.790609
## 6    5.490215    6.086065    5.652342          5.372266          5.177487
##   log2samplevsCDC53
## 1          9.256488
## 2          6.538327
## 3         13.437122
## 4         10.651844
## 5          8.724550
## 6          6.774123

Muestra 1

log2sample1 <- data4$log2sample1; head(mean(log2sample1)); head(sd(log2sample1))
## [1] 6.066239
## [1] 2.837457
head(log2sample1,5)
## [1] 7.141202 8.148215 9.879192 8.028625 6.464406
summary(data4)
##     GenId               CDC5_1              CDC5_2              CDC5_3         
##  Length:4746        Min.   :     0.00   Min.   :     0.00   Min.   :      0.0  
##  Class :character   1st Qu.:    15.16   1st Qu.:    14.49   1st Qu.:     14.1  
##  Mode  :character   Median :    41.43   Median :    42.43   Median :     49.5  
##                     Mean   :  1422.93   Mean   :  1431.84   Mean   :   3498.7  
##                     3rd Qu.:   168.75   3rd Qu.:   187.33   3rd Qu.:    237.5  
##                     Max.   :236529.55   Max.   :222485.72   Max.   :1942165.3  
##     pEhEx_1             pEhEx_2             pEhEx_3          log2sample1    
##  Min.   :     0.00   Min.   :     0.00   Min.   :     0.0   Min.   : 0.000  
##  1st Qu.:    14.85   1st Qu.:    13.20   1st Qu.:    12.6   1st Qu.: 3.986  
##  Median :    42.17   Median :    42.42   Median :    44.7   Median : 5.432  
##  Mean   :  1156.92   Mean   :  1454.96   Mean   :  1569.6   Mean   : 6.066  
##  3rd Qu.:   172.68   3rd Qu.:   191.38   3rd Qu.:   199.5   3rd Qu.: 7.440  
##  Max.   :170957.75   Max.   :224129.46   Max.   :578317.1   Max.   :17.383  
##   log2sample2      log2sample3     log2samplevsCDC51 log2samplevsCDC52
##  Min.   : 0.000   Min.   : 0.000   Min.   : 0.000    Min.   : 0.000   
##  1st Qu.: 3.828   1st Qu.: 3.767   1st Qu.: 4.014    1st Qu.: 3.953   
##  Median : 5.440   Median : 5.514   Median : 5.407    Median : 5.441   
##  Mean   : 6.019   Mean   : 5.939   Mean   : 6.074    Mean   : 6.080   
##  3rd Qu.: 7.588   3rd Qu.: 7.647   3rd Qu.: 7.407    3rd Qu.: 7.557   
##  Max.   :17.774   Max.   :19.142   Max.   :17.852    Max.   :17.763   
##  log2samplevsCDC53
##  Min.   : 0.000   
##  1st Qu.: 3.921   
##  Median : 5.658   
##  Mean   : 6.152   
##  3rd Qu.: 7.898   
##  Max.   :20.889
ndata4    <- length(log2sample1)
hist(log2sample1, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2 sample1')

meanlog2sample1 <- mean(log2sample1); head(meanlog2sample1)
## [1] 6.066239
StdDevlog2sample1 <- sd(log2sample1); head(StdDevlog2sample1)
## [1] 2.837457
Normlog2sample1 <- (log2sample1-meanlog2sample1)/StdDevlog2sample1; head(Normlog2sample1)
## [1]  0.3788472  0.7337468  1.3437920  0.6916001  0.1403251 -0.2030074
tst<- Normlog2sample1

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2sample1',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##           estimate Std. Error
## mean -5.346355e-17 0.01451411
## sd    9.998946e-01 0.01026298
## Loglikelihood:  -6733.782   AIC:  13471.56   BIC:  13484.49 
## Correlation matrix:
##               mean            sd
## mean  1.000000e+00 -3.386913e-11
## sd   -3.386913e-11  1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293

CĂ¡lculo de cuantiles

CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8625714 0.8124762
## 70 -0.9422460 0.9640896
## 75 -0.9718431 1.1342860
## 80 -1.0367684 1.3790909
## 85 -1.0726303 1.7033941
## 90 -1.1529698 2.1934547
## 95 -1.3038487 2.6233257
## 99 -1.7398510 3.1888833
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2   pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  BaseMean - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra 2

log2sample2 <- data4$log2sample2; head(mean(log2sample2)); head(sd(log2sample2))
## [1] 6.018835
## [1] 3.085311
head(log2sample2,5)
## [1]  8.442638  8.100100 10.598849  8.039359  5.774415
ndata4    <- length(log2sample2)
hist(log2sample2, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2 sample2')

Log-normalizacion

meanlog2sample2 <- mean(log2sample2); head(meanlog2sample2)
## [1] 6.018835
StdDevlog2sample2 <- sd(log2sample2); head(StdDevlog2sample2)
## [1] 3.085311
Normlog2sample2 <- (log2sample2-meanlog2sample2)/StdDevlog2sample2; head(Normlog2sample2)
## [1]  0.78559421  0.67457202  1.48445747  0.65488484 -0.07922075  0.02179028
tst<- Normlog2sample2
hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2sample1',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajuste de modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##          estimate Std. Error
## mean 4.519200e-17 0.01451411
## sd   9.998946e-01 0.01026298
## Loglikelihood:  -6733.782   AIC:  13471.56   BIC:  13484.49 
## Correlation matrix:
##      mean sd
## mean    1  0
## sd      0  1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]

print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8988548 0.8463966
## 70 -0.9478079 0.9891035
## 75 -1.0024917 1.1467315
## 80 -1.0644280 1.3749391
## 85 -1.1358390 1.6937524
## 90 -1.2201564 2.1241067
## 95 -1.4552922 2.5236980
## 99 -1.9508033 3.0984441
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2   pEhEx - ADJUSTED (sample 2)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - DATA (sample 2)', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  BaseMean - ADJUSTED (sample 2)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - ADJUSTED (sample 2)', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra 3

log2sample3 <- data4$log2sample3; head(mean(log2sample3)); head(sd(log2sample3))
## [1] 5.938851
## [1] 3.137257
head(log2sample3,5)
## [1]  8.580256  4.997864 10.726898  9.040624  5.361902
ndata4    <- length(log2sample3)
hist(log2sample3, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2 sample2')

meanlog2sample3 <- mean(log2sample3); head(meanlog2sample3)
## [1] 5.938851
StdDevlog2sample3 <- sd(log2sample3); head(StdDevlog2sample3)
## [1] 3.137257
Normlog2sample3 <- (log2sample3-meanlog2sample3)/StdDevlog2sample3; head(Normlog2sample3)
## [1]  0.84194733 -0.29993956  1.52618884  0.98868937 -0.18390246 -0.09132474
tst<- Normlog2sample3
hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2sample1',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando Modelos

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##          estimate Std. Error
## mean 1.897633e-17 0.01451411
## sd   9.998946e-01 0.01026298
## Loglikelihood:  -6733.782   AIC:  13471.56   BIC:  13484.49 
## Correlation matrix:
##      mean sd
## mean    1  0
## sd      0  1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8813312 0.8377086
## 70 -0.9785407 0.9709584
## 75 -1.0570406 1.1167404
## 80 -1.1517563 1.3292508
## 85 -1.2711789 1.6268787
## 90 -1.4329274 2.0299674
## 95 -1.5417724 2.4960043
## 99 -1.8930077 3.1029256

CreaciĂ³n de histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2   pEhEx - ADJUSTED (sample 3)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - DATA (sample 2)', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  BaseMean - ADJUSTED (sample 3)', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2  pEhEx - ADJUSTED (sample 3)', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra pEhExvsCDC51

log2vsCDC51 <- data4$log2samplevsCDC51; head(mean(log2vsCDC51)); head(sd(log2vsCDC51))
## [1] 6.073889
## [1] 2.856279
head(log2vsCDC51,5)
## [1] 5.921721 6.897596 9.430800 8.739559 6.715376
ndata4    <- length(log2vsCDC51)
hist(log2vsCDC51, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2vsCDC51')

meanlog2vsCDC51 <- mean(log2vsCDC51); head(meanlog2vsCDC51)
## [1] 6.073889
StdDevlog2vsCDC51 <- sd(log2vsCDC51); head(StdDevlog2vsCDC51)
## [1] 2.856279
Normlog2vsCDC51 <- (log2vsCDC51-meanlog2vsCDC51)/StdDevlog2vsCDC51; head(Normlog2vsCDC51)
## [1] -0.05327506  0.28838461  1.17527408  0.93326643  0.22458816 -0.24564228
tst<- Normlog2vsCDC51

Primer histograma

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2vsCDC51',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##           estimate Std. Error
## mean -1.363897e-18 0.01451411
## sd    9.998946e-01 0.01026298
## Loglikelihood:  -6733.782   AIC:  13471.56   BIC:  13484.49 
## Correlation matrix:
##      mean sd
## mean    1  0
## sd      0  1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8665460 0.8005323
## 70 -0.9105349 0.9400738
## 75 -0.9587235 1.1113009
## 80 -1.0119991 1.3461767
## 85 -1.0715638 1.6701383
## 90 -1.0715638 2.1555034
## 95 -1.3093554 2.7085444
## 99 -2.1265041 3.2907409

Histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51   pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra pEhExvsCDC52

log2vsCDC52 <- data4$log2samplevsCDC52; head(mean(log2vsCDC52)); head(sd(log2vsCDC52))
## [1] 6.079551
## [1] 2.958446
head(log2vsCDC52,5)
## [1] 6.157415 7.700407 9.768929 8.671526 6.790609

Primer Histograma

ndata4    <- length(log2vsCDC52)
hist(log2vsCDC52, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2vsCDC52')

meanlog2vsCDC52 <- mean(log2vsCDC52); head(meanlog2vsCDC52)
## [1] 6.079551
StdDevlog2vsCDC52 <- sd(log2vsCDC52); head(StdDevlog2vsCDC52)
## [1] 2.958446
Normlog2vsCDC52 <- (log2vsCDC52-meanlog2vsCDC52)/StdDevlog2vsCDC52; head(Normlog2vsCDC52)
## [1]  0.02631943  0.54787417  1.24706626  0.87612726  0.24034856 -0.30491137
tst<- Normlog2vsCDC52

** Segundo Histograma**

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2vsCDC52',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##           estimate Std. Error
## mean -9.044811e-17 0.01451411
## sd    9.998946e-01 0.01026298
## Loglikelihood:  -6733.782   AIC:  13471.56   BIC:  13484.49 
## Correlation matrix:
##               mean            sd
## mean  1.000000e+00 -3.386913e-11
## sd   -3.386913e-11  1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

CĂ¡lculo de cuantiles

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8703761 0.8136491
## 70 -0.9170047 0.9590243
## 75 -0.9685679 1.1169792
## 80 -1.0262349 1.3717093
## 85 -1.0916475 1.6775570
## 90 -1.1672140 2.1543218
## 95 -1.3663234 2.6103392
## 99 -2.0549813 3.1594798

Histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52   pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52  - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC52  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))

Muestra pEhExvsCDC53

log2vsCDC53 <- data4$log2samplevsCDC53; head(mean(log2vsCDC53)); head(sd(log2vsCDC53))
## [1] 6.151641
## [1] 3.315575
head(log2vsCDC53,5)
## [1]  9.256488  6.538327 13.437122 10.651844  8.724550
ndata4    <- length(log2vsCDC53)

** Primer histograma**

hist(log2vsCDC53, breaks = nbreaks, col= rainbow(25,0.3), 
     main = 'Log2vsCDC53')

meanlog2vsCDC53 <- mean(log2vsCDC53); head(meanlog2vsCDC53)
## [1] 6.151641
StdDevlog2vsCDC53 <- sd(log2vsCDC53); head(StdDevlog2vsCDC53)
## [1] 3.315575
Normlog2vsCDC53 <- (log2vsCDC53-meanlog2vsCDC53)/StdDevlog2vsCDC53; head(Normlog2vsCDC53)
## [1] 0.9364429 0.1166271 2.1973504 1.3572917 0.7760066 0.1877447
tst<- Normlog2vsCDC53

Segundo histograma

hist(tst, breaks = nbreaks, col= 1:5, 
     main = 'Normalized Log2vsCDC53',
     xlab='pEhEx1',
     ylab= 'Frequency pEhEx')

Ajustando modelo

fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)

nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood 
## Parameters : 
##           estimate Std. Error
## mean -1.080389e-16 0.01451411
## sd    9.998946e-01 0.01026298
## Loglikelihood:  -6733.782   AIC:  13471.56   BIC:  13484.49 
## Correlation matrix:
##      mean sd
## mean    1  0
## sd      0  1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')

Calculo de cuantiles

probs <- c();
probs[8] = 0.175;  probs[9] = 0.825; 
probs[7] = 0.15;   probs[10] = 0.85;   
probs[6] = 0.125;  probs[11] = 0.875; 
probs[5] = 0.1;    probs[12] = 0.9;    
probs[4] = 0.075;  probs[13] = 0.925; 
probs[3] = 0.05;   probs[14] = 0.95;   
probs[2] = 0.025;  probs[15] = 0.975; 
probs[1] = 0.005;  probs[16] = 0.995;  
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
                            '10%','12.5%','15%','17.5%',
                            '82.5%','85%','87.5%','90%',
                            '92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
##       Cuantiles Ajuste
## 0.5%        -2.5758293
## 2.5%        -1.9599640
## 5%          -1.6448536
## 7.5%        -1.4395315
## 10%         -1.2815516
## 12.5%       -1.1503494
## 15%         -1.0364334
## 17.5%       -0.9345893
## 82.5%        0.9345893
## 85%          1.0364334
## 87.5%        1.1503494
## 90%          1.2815516
## 92.5%        1.4395315
## 95%          1.6448536
## 97.5%        1.9599640
## 99.5%        2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8];  CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7];  CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6];  CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5];  CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4];  CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3];  CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2];  CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1];  CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
##        LimInf    LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
##        LimInf    LimSup
## 65 -0.8351247 0.8675257
## 70 -0.9466147 0.9977469
## 75 -0.9466147 1.1516663
## 80 -1.0968948 1.3476203
## 85 -1.3283399 1.5933747
## 90 -1.3283399 1.8884142
## 95 -1.8553769 2.3619041
## 99 -1.8553769 3.1601836

Histogramas

col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty = 9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53   pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue");  # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4");  # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown");  # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red");  # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue");  # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange");  # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
       legend=c("65%","70%","75%","80%","85%","90%","95%","99%"), 
       pch=c(1,2,3,4,5,6,7,8),
       col=c("darkgoldenrod4","darkblue","aquamarine4",
             "green", "brown","red","blue","orange"))

Grafica Cuantiles del \(65\%\) y \(80\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53  pEhEx - DATA', lty=9)

abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC51  - ADJUSTED', lty=9)

abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green");  # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"), 
       pch=c(1,2),col=c("darkgoldenrod4","green"))

Grafica Cuantiles del \(70\%\) y \(85\%\)

par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence, 
     main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty=9)

abline(v=CuantilesA[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown"); 
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
     main = 'Normalized Log2vsCDC53  pEhEx - ADJUSTED', lty=9)

abline(v=CuantilesD[2,1], lty=2, col="darkblue"); 
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown"); 
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
       pch=c(1,2),#3,4,5,6,7,8),
       col=c("brown"))